﻿using System;
using GeneralDFS.DataEntity.Enum;
using ProtoBuf;

namespace GeneralDFS.DataEntity.Nodes
{
    [ProtoContract]
    [Serializable]
    public class DataNodeID:IComparable<DataNodeID>
    {
        [ProtoMember(1)]
        public String Name { set; get; }

        [ProtoMember(2)]
        public String Ip { set; get; }

        [ProtoMember(3)]
        public int RpcPort { set; get; }

        [ProtoMember(4)]
        public int Index { set; get; }

        [ProtoMember(5)]
        public int TcpPort { set; get; }

        public int CompareTo(DataNodeID other)
        {
            return String.CompareOrdinal(Name, other.Name);
        }
    }
}